'''
	Contains a Cylinder geom.
	
	@author: J.H.Donker
	@copyright: Twente University
'''

import vtk
import wx

from wx.lib.pubsub import Publisher
from HeaDSETGeom import *

class HeaDSETCylinder(HeaDSETGeom):
	
	# default properties
	#DEFSIZE = {'length': 1.00, 'radius': 0.50, 'resolution': 50}
	
	
	#constructor
	def __init__(self, label = HeaDSETGeom.CYLINDER):
		'''
			This geom is a Cyclinder. 
			
			@param label: The desired label. Defaults to HeaDSETGeom.CYLINDER.
		'''		
		# create cylinder source
		cylinder = vtk.vtkCylinderSource()
		cylinder.SetHeight(self.DEFSIZE['length'])
		cylinder.SetRadius(self.DEFSIZE['radius'])
		cylinder.SetResolution(self.DEFSIZE['resolution'])
		
		# create poly mapper
		cylinderMapper = vtk.vtkPolyDataMapper()
		cylinderMapper.SetInput(cylinder.GetOutput())
		
		# create actor
		actor = HeaDSETVTKActor()
		actor.SetMapper(cylinderMapper)
		actor.SetGeom(self)
		
		# call super constructor
		HeaDSETGeom.__init__(self, actor, label)
	
	def TypeCopy(self):
		'''
			Returns a new HeaDSETCylinder.
				
			@return: Fresh HeaDSETCylinder.
		'''
		return HeaDSETCylinder(self.GetLabel())
